package com.yy.xshell.auth;

/**
 * @author wxy
 * @version 1.0
 * @date 2024/8/16 17:34
 */
public class SessionContext {

    private static final ThreadLocal<UserSessionInfo> USER_INFO_HOLDER = new ThreadLocal<UserSessionInfo>();

    private SessionContext() {}

    public static UserSessionInfo get() {
        return USER_INFO_HOLDER.get();
    }

    public static void clear() {
        USER_INFO_HOLDER.remove();
    }

    public static void set(UserSessionInfo user) {
        USER_INFO_HOLDER.set(user);
    }

}
